// components/footerTrans/footerTrans.js
Component({
  externalClasses: ['external_text'],
  /**
   * 组件的属性列表
   */
  properties: {
    url: {
      type: String,
      value: ''
    },
    text: {
      type: String,
      value: ''
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    footerShow: false,
    timer: ''
  },
  ready() {
    const that = this
    this.setData({
      timer: setInterval(function() {
        const show = !that.data.footerShow
        that.setData({
          footerShow: show
        })
        },1600)
    })
  },
  // 清除定时器
  detached: function () {
    clearInterval(this.data.timer)
  },
  /**
   * 组件的方法列表
   */
  methods: {
    tapFooter() {
      clearInterval(this.data.timer)
      wx.redirectTo({
        url: this.data.url
      })
    },
  }
})
